#define _CRT_SECURE_NO_WARNINGS 1
#include"game.h"
void Menu()
{
	printf("-------------\n");
	printf("-----Menu----\n");
	printf("-------------\n");
	printf("-   1.Play  -\n");
	printf("-------------\n");
	printf("-   0.Exit  -\n");
	printf("-------------\n");
}

void game()
{
	//创建棋盘
	char Mine[ROWS][COLS] = { 0 };
	char Show[ROWS][COLS] = { 0 };
	//初始化棋盘
	InitBoard(Mine,ROWS,COLS,'0');
	InitBoard(Show,ROWS,COLS,'*');
	//打印棋盘
	PrintBoard(Show, ROW, COL);
	//布置雷
	SetMine(Mine,ROW,COL);
	//PrintBoard(Mine,ROW,COL);//验证
	
	//排查雷
	SweepMine(Mine,Show,ROW,COL);
}
void test()
{
	int input = 0;
	do
	{
		Menu();
		printf("请选择>");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			break;
		default:
			printf("输入错误，请输入（1/0）\n");
			break;
		}

	} while (input);
}



int main()
{
	srand((unsigned int)time(NULL));
	test();

	return 0;
}
